package flc.ast.fragment;

import android.os.Bundle;

import androidx.fragment.app.Fragment;

import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import flc.ast.R;
import flc.ast.activity.SelPicActivity;
import flc.ast.databinding.FragmentPuzzleBinding;
import stark.common.basic.base.BaseNoModelFragment;
import stark.common.basic.event.EventStatProxy;

/**
 * A simple {@link Fragment} subclass.
 * Use the {@link PuzzleFragment#newInstance} factory method to
 * create an instance of this fragment.
 */
public class PuzzleFragment extends BaseNoModelFragment<FragmentPuzzleBinding> {


    @Override
    protected int onCreate() {
        return R.layout.fragment_puzzle;
    }

    @Override
    protected void initView() {
        EventStatProxy.getInstance().statEvent1(getActivity(), mDataBinding.event1Container);
        EventStatProxy.getInstance().statEvent5(getActivity(), mDataBinding.event5Container);

        mDataBinding.ivPuzzle.setOnClickListener(this);
        mDataBinding.ivOriVertical.setOnClickListener(this);
        mDataBinding.ivOriHorizontal.setOnClickListener(this);
        mDataBinding.ivTemplate1.setOnClickListener(this);
        mDataBinding.ivTemplate2.setOnClickListener(this);
        mDataBinding.ivTemplate3.setOnClickListener(this);
        mDataBinding.ivTemplate4.setOnClickListener(this);
    }

    @Override
    protected void onClickCallback(View v) {
        switch (v.getId()) {
            case R.id.ivPuzzle://拼图
                SelPicActivity.type = 0;
                startActivity(SelPicActivity.class);
                break;
            case R.id.ivOriVertical://竖图拼接
                SelPicActivity.type = 1;
                startActivity(SelPicActivity.class);
                break;
            case R.id.ivOriHorizontal://横图拼接
                SelPicActivity.type = 2;
                startActivity(SelPicActivity.class);
                break;
            case R.id.ivTemplate1://模板1
                SelPicActivity.type = 3;
                startActivity(SelPicActivity.class);
                break;
            case R.id.ivTemplate2://模板1
                SelPicActivity.type = 4;
                startActivity(SelPicActivity.class);
                break;
            case R.id.ivTemplate3://模板1
                SelPicActivity.type = 5;
                startActivity(SelPicActivity.class);
                break;
            case R.id.ivTemplate4://模板1
                SelPicActivity.type = 6;
                startActivity(SelPicActivity.class);
                break;
        }
    }

    @Override
    protected void initData() {

    }
}